package com.xm.singleton;

/**
 * 懒汉式（线程安全版，同步方法）
 */
public class CSyn {
    private static CSyn instance;
    private CSyn() {}

    public static synchronized CSyn getInstance() {
        if (instance == null) {
            instance = new CSyn();
        }
        return instance;
    }
}
